import { HTTP } from '../utils/http-p.js'

const app = getApp()
class FormModel extends HTTP{

    addProduction(params){
        app.checkLoginStatus()
        return this.request({
            url: '/v/production/addProduction',
            method: 'POST',
            data: {
                name: params.name,
                intro: params.intro,
                equipment: params.equipment,
                shootAddress: params.shootAddress,
                returnFilm: params.returnFilm,
                isOneself: params.isOneself,
                subjectIds: params.subjectIds
            }
        })
    }

    addShoot(params){
        app.checkLoginStatus()
        return this.request({
            url: '/v/shoot/addShoot',
            method: 'POST',
            data: {
                shootType: params.shootType,
                requirement: params.requirement,
                chargingModel: params.chargingModel,
                region: params.region,
                shootTime: params.shootTime,
                shootAddress: params.shootAddress,
                shootFile: params.shootFile,
                price: params.price,
                subjectIds: params.subjectIds
            }
        })
    }

    addPlace(params){
        app.checkLoginStatus()
        return this.request({
            url: '/v/place/addPlace',
            method: 'POST',
            data: {
                placeName: params.placeName,
                placeIntro: params.placeIntro,
                placeAddress: params.placeAddress,
                placeTypeId: params.placeTypeId,
                region: params.region,
                subjectIds: params.subjectIds
            }
        })
    }

    getPlaceTypeList() {
        return this.request({
            url: '/v/place/type/getPlaceTypeList',
        })
    }
}

export { FormModel }
